/*
 * The public interface of cacheflex, they are expected to be used
 * by the final users.
 */
#ifndef __CACHEFLEX_BASE_API__
#define __CACHEFLEX_BASE_API__
#include "include/base-api/cf_base_types.h"

extern int cf_put(cacheflex_t *cache, void *key, void *value, const int overwrite_key, const int overwrite_value);

extern int cf_get(cacheflex_t *cache, void *key, void **value, cf_ref_handle_t **ref_handle);

extern void cf_deref(cacheflex_t *cache, cf_ref_handle_t *ref_handle);

extern int cf_erase(cacheflex_t *cache, void *key);

extern int cf_scan(cacheflex_t *cache, cf_scan_callback_pt scan_callback, void *args);

extern cacheflex_t *cf_init(const int64_t cache_size_limit,
                            const int64_t item_num_limit,
                            const cf_kv_store_type_t kv_store_type,
                            cf_kv_ops_t kv_ops,
                            cf_index_interface_t index_interface,
                            cf_store_interface_t store_interface,            
                            cf_reclaim_interface_t reclaim_interface,
                            cf_generic_alloc_pt generic_alloc,
                            cf_generic_free_pt generic_free,
                            cf_write_log_pt write_log);

extern void cf_destroy(cacheflex_t *cache);

#endif // __CACHEFLEX_BASE_API__

